package com.mcf.xiaolinju.controller;


import com.mcf.xiaolinju.entity.TbCity;
import com.mcf.xiaolinju.entity.TbTown;
import com.mcf.xiaolinju.service.impl.TbTownServiceImpl;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mcf
 * @since 2022-01-04
 */
@CrossOrigin
@RestController
@RequestMapping("/xiaolinju/tb-town")
public class TbTownController {
    @Resource
    TbTownServiceImpl tbTownService;
    //根据城市id查询地区
    @RequestMapping("/gettown")
    public List<TbTown> gettown(int cityid){
        return tbTownService.gettown(cityid);
    }
    //查询所有
    @RequestMapping("/getAll")
    public List<TbTown> getAll(){ return tbTownService.list();}

}
